---
title: Charmhub | tempo-k8s docs - How to integrate with `grafana-k8s`
description: Integrate Tempo as a Datasource in Grafana Assuming you have a charmed
  application whose workload or charm is instrumented and is pushing traces into...
url: https://charmhub.io/topics/charmed-tempo-ha/integrate grafana
---

# tempo-k8s docs - How to integrate with `grafana-k8s`

# Integrate Tempo as a Datasource in Grafana

Assuming you have a charmed application whose workload or charm is instrumented and is pushing traces into Tempo.

As part of powerful Tempo capabilities, you can configure Tempo as a datasource to a `grafana-k8s` instance to view traces and spans there.

## [Deploy `grafana-k8s`](https://charmhub.io/topics/charmed-tempo-ha/integrate grafana#p-31328-deploy-grafana-k8s)

skip this section if you have a [cos-lite](https://juju.is/docs/sdk/observe-your-charm-with-cos-lite#heading--deploy-cos-lite) bundle deployed.

```
juju deploy grafana-k8s grafana --trust
```

## [Integrate with grafana on `grafana-source`](https://charmhub.io/topics/charmed-tempo-ha/integrate grafana#p-31328-integrate-with-grafana-on-grafana-source)

`juju integrate tempo:grafana-source grafana:grafana-source`

integrating over `grafana-source` endpoint will provision `tempo` as a data source in `grafana`.

## [Integrate with grafana on `tracing`](https://charmhub.io/topics/charmed-tempo-ha/integrate grafana#p-31328-integrate-with-grafana-on-tracing)

`juju integrate tempo:tracing grafana:tracing`

integrating over `tracing` endpoint will instrument `grafana` charm to push its charm traces to `tempo`.
soon, [`grafana-k8s`](https://charmhub.io/grafana-k8s) will have support to send its `workload` traces as well once `tracing` relation is established.

## [View `grafana` traces](https://charmhub.io/topics/charmed-tempo-ha/integrate grafana#p-31328-view-grafana-traces)

first, we need to open `grafana` web UI by following [accessing grafana UI from host machine](https://juju.is/docs/sdk/observe-your-charm-with-cos-lite#heading--access-your-applications-from-the-host-machine).

Then, open Grafana web UI form your local web browser and login using the [admin password](https://juju.is/docs/sdk/observe-your-charm-with-cos-lite#heading--log-in-to-grafana).

Then:

```
Toggle Menu → Explore → Choose your tempo datasource
```

Then, run `TraceQL` query below:

```
{.service.name = "grafana"}
```

This should result in an output similar to the one below:

you can view all traces pushed by `grafana` and inspect their spans. See more about [traces and spans in the Charm Realm](https://charmhub.io/topics/charmed-tempo-ha/traces & spans in charm realm)

---

*Last updated 2 years ago.*

[Help improve this document in the forum](https://discourse.charmhub.io/t/tempo-k8s-docs-how-to-integrate-with-grafana-k8s/14013).
